package com.kongfanyu.springcloud.service.impl;

import com.kongfanyu.springcloud.dao.StorageDao;
import com.kongfanyu.springcloud.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Copyright (C), 2018-2020
 * FileName: StorageServiceImpl
 * Author:   kongfanyu
 * Date:     2020/9/6 14:00
 */
@Slf4j
@Service
public class StorageServiceImpl implements StorageService {

    @Resource
    private StorageDao storageDao;
    @Override
    public void decrease(Integer productId,Integer count) {
        log.info("-------》库存微服务开始扣减库存");
        log.info("StorageServiceImpl----productId={},count={}",productId,count);
        storageDao.decrease(productId,count);
        log.info("-------》库存微服务结束扣减库存");
    }
}
